#ifndef __PCAP__
#define __PCAP__
#include "Net_Struct.h"


//typedef void(*PacketDataCallBack)(char* data, int length);

class CReadPcap
{
public:
	CReadPcap();
	~CReadPcap();
	IP_PCAP_LIST_HEAD *GetPacket(const wchar_t*path ,const wchar_t *dst_ip, const unsigned int dst_port ,const wchar_t *src_ip, const unsigned int src_port);
	bool ListPacket(void);   //use in test
private:
	bool InitPacp(const wchar_t* path);
	bool InsertPcapIntoList(PcapPkHeader *ip_node_header, unsigned char *data);
	bool Release_All_Pcap_Node(void);
	
	FILE*	_file;
	IP_PCAP_LIST_HEAD  m_pcap_header;
	bool ListIsUsing;
	bool CompareWithIpAndPort(const wchar_t *ip,const unsigned int port,const unsigned char *ph);
	
//	PacketDataCallBack _foo;

};

#endif